/*
 * CommentDetails.fx
 * Author: Yu Min-ting
 * Created on 2009-7-29, 13:12:16
 */

package com.sjtu.fx.comments;

import javafx.scene.*;
import com.sjtu.fx.tools.Panel;
import javafx.scene.control.Label;

import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;


import com.sjtu.fx.tools.SwingTextArea;
import javafx.scene.control.Button;

public class CommentDetails extends CustomNode{
     var panel:Panel;
     public var description:String = bind description with inverse;
     public var date:String = bind date with inverse;
     public var name:String = bind name with inverse;
     public var score:String = bind score with inverse;

     var nameLabel = Label {
             text: "User Name :"
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }
     var nameInform = Label {
             text: bind name
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }

     var dateLabel = Label {
             text: "Request Date :"
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }
     var dateInform = Label {
             text: bind date
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }

     var scoreLabel = Label {
             text: "Score :"
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }
     var scoreInform = Label {
             text: bind score
             font: Font {size:12 name: "Verdana Bold"}
             textFill: Color.rgb(11,51,60)
         }

     var commentInform = Label {
             text: "Comment on Book:"
             font: Font {size:12 name: "Verdana Bold" }
             textFill: Color.rgb(11,51,60)
         }
    var comment = SwingTextArea{
        text: bind description
        columns:50
        rows:6
        editable:false
    }

     var ok = Button {
             translateX:360 translateY:250
             text: "OK"
             action: function() {
                 visible = false;
             }
         }
     
     override protected function create() : Node{
          Group{
            content:[
                panel = Panel {
                    width:    780
                    height:   305
                    title:    "Comments Details"
                },
                VBox{
                    spacing:15
                    translateX:25 translateY:50
                    content:[
                            dateLabel,
                            nameLabel,
                            scoreLabel,
                            commentInform,

                        ]
                },
                 VBox{
                    spacing:15
                    translateX:195 translateY:50
                    content:[
                            dateInform,
                            nameInform,
                            scoreInform,                           
                            comment,

                        ]
                },ok
                
                ]
          }
     }

}
